﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entities;
using System.Data.Entity;

namespace DAL
{
    public class QuestionContext : DbContext
    {
        public DbSet<Question> Questions { get; set; }
        public QuestionContext()
            : base("Nhom15")
        {

        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            #region phan nay chua can
            modelBuilder.Entity<Question>().ToTable("CauHoi");
            modelBuilder.Entity<Question>().HasKey(x => x.ID);
            modelBuilder.Entity<Question>()
               .Property(x => x.ID)
               .HasColumnName("ID");

            modelBuilder.Entity<Question>()
                .Property(x => x.MoTa)
                .HasColumnName("MieuTa");

            #endregion
        }
    }
}
